<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root"></div>
    <script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
    <script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
    <script type="text/babel">
        let Card = function(props){
            let style = {
                width:"150px",
                height:"150px",
                fontSize:"40px",
                color:"black",
                backgroundColor:"red",
                textAlign:"center",
                lineHeight:"150px",
                marginLeft:"5px",
                ...props.style
            };
            return <div style={style}>
                    {props.children}
                </div>
        }
        let RootElement = function(){
            let ary = [{
                letter:"A",
                style:{
                    color:"black",
                    backgroundColor:"blue"
                }
            },
            {
                letter:"B",
                style:{
                    color:"white",
                    backgroundColor:"green"
                }
            },
            {
                letter:"C",
                style:{
                    color:"red",
                    backgroundColor:"yellow"
                }
            }];
            return <div style={{display:"flex"}}>
                {ary.map((ele) => <Card style={ele.style}>{ele.letter}</Card>)}    
            </div>
        }
        ReactDOM.render(<RootElement />,document.getElementById("root"));
    </script>
</body>
</html>